#ifndef REGISTERWINDOW_H
#define REGISTERWINDOW_H

#include <QObject>
#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QStackedWidget>

class RegisterWindow : public QWidget
{
    Q_OBJECT
public:
    RegisterWindow(QStackedWidget *stackedWidget, QWidget *parent = nullptr);

private:
    QLabel* m_captchaLabel;
    QLineEdit* m_usernameInput;
    QLineEdit* m_passwordInput;
    QLineEdit* m_surePasswordInput;
    QLineEdit* m_captchaInput;
    QPushButton* m_registerButton;
    QPushButton* m_backButton;
    QPushButton* m_refreshCaptchaButton;
    QString m_currentCaptcha;

    QStackedWidget *stackedWidget;

    void generateCaptcha();
    void initUI();
    void setupConnections();

private slots:
    void onRegisterClicked();
    void onBackClicked();
    void onRefreshCaptcha();
};

#endif // REGISTERWINDOW_H
